Quick hack to make sure that pirqs and interdomain event channels are
authorsos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>
Thu, 7 Jul 2005 09:27:25 +0000 (09:27 +0000)
committersos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>
Thu, 7 Jul 2005 09:27:25 +0000 (09:27 +0000)
all bound to vcpu0, rather vcpu0 99% of the time and an entirely
random otherwise.  This make sure things work nicely when you start
taking vcpus offline, since vcpu0 can't go offline; the correct
solution is to allow domains to change evtchn<->vcpu bindings.

Signed-off-by: Steven Smith, sos22@cl.cam.ac.uk
xen/common/event_channel.c

index 29d10ef3d2159a247deca49c6d744a883c9c2c40..df97403972cb2523fd0c981fc43ce9d75bc793f4 100644 (file)
@@ -220,10 +220,12 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
 
     chn1->u.interdomain.remote_dom  = d2;
     chn1->u.interdomain.remote_port = (u16)port2;
+    chn1->notify_vcpu_id            = 0;
     chn1->state                     = ECS_INTERDOMAIN;
     
     chn2->u.interdomain.remote_dom  = d1;
     chn2->u.interdomain.remote_port = (u16)port1;
+    chn2->notify_vcpu_id            = 0;
     chn2->state                     = ECS_INTERDOMAIN;
 
  out:
@@ -324,8 +326,10 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
 
     chn = evtchn_from_port(d, port);
 
+    chn->notify_vcpu_id = 0;
+
     d->pirq_to_evtchn[pirq] = port;
-    rc = pirq_guest_bind(d->vcpu[chn->notify_vcpu_id], pirq, 
+    rc = pirq_guest_bind(d->vcpu[0], pirq, 
                          !!(bind->flags & BIND_PIRQ__WILL_SHARE));
     if ( rc != 0 )
     {